﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace RadioStationPOC.Views
{
    /// <summary>
    /// CallRecords.xaml 的交互逻辑
    /// </summary>
    public partial class CallRecords : Window
    {
        public CallRecords(List<CallRecordsModel> calls)
        {
            InitializeComponent();
            callRecords = calls;
        }
        List<CallRecordsModel> callRecords = new List<CallRecordsModel>();

        /// <summary>
        /// 双击
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Label_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            this.WindowState = this.WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
        }

        /// <summary>
        /// 移动
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DockPanel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            this.DragMove();
        }

        /// <summary>
        /// 最小化
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void WindowMin_Click(object sender, RoutedEventArgs e)
        {
            this.WindowState = WindowState.Minimized;
        }

        /// <summary>
        /// 关闭
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void WindowClose_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        /// <summary>
        /// 最大化
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void WindowMax_Click(object sender, RoutedEventArgs e)
        {
            this.WindowState = this.WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            lstCallRecords.ItemsSource = callRecords;
        }
    }
    public class CallRecordsModel : NotifyPropertyChanged
    {

        /// <summary>
        /// 呼入还是呼出
        /// </summary>
        private Brush m_Background = Brushes.Transparent;
        /// <summary>
        /// 背景色
        /// </summary>
        public Brush Background
        {
            get
            {
                return this.m_Background;
            }
            set
            {
                this.m_Background = value;
                this.OnPropertyChanged();
            }
        }
        /// <summary>
        /// 操作类型
        /// </summary>
        private string _operationtType;
        public string OperationtType
        {
            get
            {
                return this._operationtType;
            }
            set
            {
                this._operationtType = value;
                this.OnPropertyChanged();
            }
        }

        /// <summary>
        /// 站名
        /// </summary>
        private string _stationName;
        public string StationName
        {
            get
            {
                return this._stationName;
            }
            set
            {
                this._stationName = value;
                this.OnPropertyChanged();
            }
        }
        /// <summary>
        /// 呼叫内容
        /// </summary>
        private string _stepContent;
        public string StepContent
        {
            get
            {
                return this._stepContent;
            }
            set
            {
                this._stepContent = value;
                this.OnPropertyChanged();
            }
        }

        private string _station;
        /// <summary>
        /// 车站
        /// </summary>
        public string Station
        {
            get
            {
                return this._station;
            }
            set
            {
                this._station = value;
                this.OnPropertyChanged();
            }
        }


        private string _keyword;
        /// <summary>
        /// 关键字
        /// </summary>
        public string Keyword
        {
            get
            {
                return this._keyword;
            }
            set
            {
                this._keyword = value;
                this.OnPropertyChanged();
            }
        }
    }
}
